module.exports = function ($scope, $state, $resource, $modal, toaster){

	
	//查询全部已设的商户列表
	$scope.search = function (){
		$resource('/api/ac/pc/payBmAccountService/getServiceChargeList', {}, {}).save(null, function(res){
			if(res.errcode === 0){
				$scope.list = res.data;
			}else{
				toaster.error({title: '', body: res.errmsg});
			}
		});
	}
	$scope.search();


	//添加|修改商户服务费标准
	$scope.set = function(info, flag) {
		var modalInstance = $modal.open({
			template: require('../views/updateServiceCharge.html'),
			controller: 'updateServiceCharge',
			size: 'lg',
			resolve: {
				obj: function () {
					return info;
				},
				update: function () {
					return flag;
				}
			}
		});
		//关闭模态框刷新页面
		modalInstance.result.then(function(result){
            $scope.search();
		});
	}

};